/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;

/**
 *
 * @author Sven
 */
@Entity
public class NotaService implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @Column(unique = true)
    private String nomorNota;
    @ManyToOne(cascade = CascadeType.ALL)
    private JenisService Jservice;
    @ManyToOne(cascade = CascadeType.ALL)
    private Pelanggan pelanggan;
    @ManyToOne(cascade = CascadeType.ALL)
    private JenisSparePart Jspart;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date tangga;
    private double total;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NotaService)) {
            return false;
        }
        NotaService other = (NotaService) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.NotaService[ id=" + id + " ]";
    }

    /**
     * @return the nomoNota
     */
    public String getNomorNota() {
        return nomorNota;
    }

    /**
     * @param nomoNota the nomoNota to set
     */
    public void setNomorNota(String nomorNota) {
        this.nomorNota = nomorNota;
    }

    /**
     * @return the Jservice
     */
    public JenisService getJservice() {
        return Jservice;
    }

    /**
     * @param Jservice the Jservice to set
     */
    public void setJservice(JenisService Jservice) {
        this.Jservice = Jservice;
    }

    /**
     * @return the pelanggan
     */
    public Pelanggan getPelanggan() {
        return pelanggan;
    }

    /**
     * @param pelanggan the pelanggan to set
     */
    public void setPelanggan(Pelanggan pelanggan) {
        this.pelanggan = pelanggan;
    }

    /**
     * @return the Jspart
     */
    public JenisSparePart getJspart() {
        return Jspart;
    }

    /**
     * @param Jspart the Jspart to set
     */
    public void setJspart(JenisSparePart Jspart) {
        this.Jspart = Jspart;
    }

    /**
     * @return the tangga
     */
    public Date getTangga() {
        return tangga;
    }

    /**
     * @param tangga the tangga to set
     */
    public void setTangga(Date tangga) {
        this.tangga = tangga;
    }

    /**
     * @return the total
     */
    public double getTotal() {
        return total;
    }

    /**
     * @param total the total to set
     */
    public void setTotal(double total) {
        this.total = total;
    }
    
}
